<?php namespace Home\Controller;
use Hdphp\Controller\Controller;
//列表页控制器lk
class ListController extends Controller{
	//首页
	public function index(){
		//获取分类id
		$cid=Q("get.cid",0,"intval");
		//实例化模型
		$cateModel=new \Common\Model\Cate;
		//获得分类的cid 名字  父级id
		$cate=$cateModel->get();
		
		$cids=$cateModel->getSon($cate,$cid);
		$cids[]=$cid;
		
		$goodDate=Db::table('goods')->whereIn("class_cid",$cids)->get();
		//sp($goodDate);exit;
		View::with('goodDate',$goodDate);
		
		
		View::make();
}

}

